knitr::opts_chunk$set(echo = TRUE, warning = F, message = F)

box::use(
  here[...], 
  ggplot2[...], 
  tidyr[...],
  dplyr[...], 
  ggridges[...],
  reactable[...],
  lubridate[ymd, year], 
  stringr[str_wrap],
  forcats[fct_reorder2], 
  htmltools[h5], 
  htmlwidgets[prependContent],
  plotly[...]
)

source(here('R/funcs.R'))

load(file = here('data/vegdat.RData'))
load(file = here('data/treedat.RData'))

thm <- theme_minimal(base_size = 14) + 
  theme(
    panel.grid.minor = element_blank() 
  )

# test args
site <- 'Cockroach'
sp <- 'Avicennia germinans'

Plot showing number of times a zone was identified across transects, dates.

zonecnt_plo(vegdat, thm)

An evaluation of a single species across all sites, can be shown as frequency occurrence across the transect or mean percent basal cover. This example shows frequency occurrence of Avicennia germinans.

sppsum_plo(vegdat, sp, var = 'fo', qrt = NULL, thm = thm)

And now average percent basal cover.

sppsum_plo(vegdat, sp, var = 'cover', thm = thm)

A table of species frequency occurrence by zone, over time:

sitezonesum_tab(vegdat, site = site)

Same thing but as percent basal cover.

sitezonesum_tab(vegdat, site = site, var = 'cover')

A plot of sum of percent basal cover for top species and across zones.

sitesum_plo(vegdat, site, vegsel = 8, var = 'cover', thm = thm)

A plot of sum of percent basal cover for top species and select zones.

sitesum_plo(vegdat, site, vegsel = 8, var = 'cover', zone = c('Mangrove', 'Freshwater Marsh'), thm = thm)

Tabular summary of tree data by site, species.

treesum_tab(treedat, site = site, byspecies = T, var = 'trees_ha')
Cockroach, Absolute species density (trees/ha)

Same table as above, but aggregated across species.

treesum_tab(treedat, site = site, byspecies = F, var = 'trees_ha')
Cockroach, Absolute species density (trees/ha)

Tree summary plot by site, species.

treesum_plo(treedat, site = site, byspecies = T, var = 'trees_ha', thm = thm)

Tree summary plot, but aggregated across species.

treesum_plo(treedat, site = site, byspecies = F, var = 'trees_ha', thm = thm)